package tool

import (
	"github.com/bwmarrin/snowflake"
	"github.com/gofrs/uuid"
)

// 雪花算法ID
func GetSFID() (int64, error) {
	node, err := snowflake.NewNode(1)
	if err != nil {
		return 0, err
	}

	return node.Generate().Int64(), nil
}

// UUID
func GetUUID() (string, error) {
	newV4, err := uuid.NewV4()
	if err != nil {
		return "", err
	}

	return newV4.String(), nil
}
